Position

inner class Position

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val date: Int
Link copied to clipboard
val fee: Long
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard

Returns the actual cost basis impact that this position's SplitTxn transaction has on the running cost basis INFO: there are some txns for which CostCalculation will return a Position with a cost basis that does not actually affect the running total.. e.g. average cost, sell zero shares for an amount when the total shares owned is zero. With zero shares owned there cannot be a cost basis balance. e.g. lot controlled, misc exp (zero shares), with fee. A txn with zero shares cannot be lot matched to it corresponding buy/sell. NOTE: lot controlled, sell txns that caused invalid cost basis will return null.

Link copied to clipboard

Lot controlled: returns true when this buy lot is over-matched - its matched sells take more shares than it holds. SCB: MD2027(5512) - fix: true only when the lot validity check (getInvalidLotMatchSellTxns) also flagged one of its sells. unallottedSharesAdded alone can dip below zero by a rounding unit after an uneven split (each sell is converted back to the buy date separately), on a lot the check passes.

Link copied to clipboard
fun price(excludeFee: Boolean): Double

Return the price of this transaction, excluding the fee if excludeFee==true

Link copied to clipboard
open override fun toString(): String